dir=/data4/bsi/bioinf_ext1/s112349.ucsf/newdata/MAYO
geno=snps_chr5
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr7
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr8
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr9
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr11
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr17
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

geno=snps_chr20
awk '{print $2,$2}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/I id /' | awk '{printf "%s\n",$0}' > $dir/$geno.bgl
awk '{print $6,$6}' "$dir/$geno.tfam" | awk '{printf "%s ",$0}' | sed 's/^/A aff /' | awk '{printf "%s\n",$0}' >> $dir/$geno.bgl
sed 's/^\S* /M /' "$dir/$geno.tped" | cut -d ' ' -f1,2,5- >> $dir/$geno.bgl
gzip $dir/$geno.*

